let events = {};

window.eManager = {


    on(key, listener, target) {

        if (!events[key])
            events[key] = [];

        events[key].push(listener.bind(target))

    },
    emit(key, data) {
        if (events[key] && events[key].length) {
            events[key].forEach(fn => {
                fn(data);
            })
        }
    }
}